<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.qipay.baas.model.ChannelType" %>
<%@ page import="java.util.List" %>
<html>
<head>
    <title>测试页面</title>
    <script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <style>
        .inputClass{
            width: 45%;
            padding:7px 0;
        }
    </style>
</head>
<body>
<%
List<ChannelType> channelTypes = (List<ChannelType>)request.getAttribute("channelTypes");
%>

<div style="padding-left: 100px;">
    <form action="<%=request.getContextPath()%>/redirect/v1/conn/testApi" method="post" >
        <div ></br></br>

            支付方式：<select name="type" class="inputClass">
                <% for (ChannelType channelType:channelTypes)  {%>
                <option value="<%= channelType.getId()%>"><%= channelType.getName()%>
                </option>
                <%}%>
            </select></br></br>

            渠道编码：<input  name="spId" value="" type="number"
                         class="inputClass"/>
            <span style="color: red;">*渠道列表的ID号</span></br></br>

            订单金额：<input  name="money" value=""  type="number"
                         class="inputClass"/>
            <span style="color: red;">*单位是元</span></br></br>


        </div></br>
    </form>
    <button type="button" onclick="submitForm()" style="padding: 5px 10px;margin-left: 5.6%;">提交</button>

</div>
<script>
    function submitForm(){
        var money = $('input[name=money]').val();
        var spId = $('input[name=spId]').val();
        if(money==''||spId==''){
            alert("缺少必填参数");
            return;
        }
        if(money*1<0||spId*1<0){
            alert("请填写正整数");
            return;
        }

        $('form').submit();
    }
</script>
</body>
</html>
